"use strict";

/**
 * @ngdoc overview
 * @name jgappApp
 * @description
 * # jgappApp
 *
 * Main module of the application.
 */

angular
  .module("jgappApp", [
    "ngAnimate",
    "ngRoute",
    "ngSanitize",
    "LocalStorageModule",
    "ngTouch",
    "infinite-scroll",
    "baiduMap"
  ])
  .config([
    "$routeProvider",
    "$httpProvider",
    "localStorageServiceProvider",
    "$locationProvider",
    function (
      $routeProvider,
      $httpProvider,
      localStorageServiceProvider,
      $locationProvider
    ) {
      // Intercept POST requests, convert to standard form encoding
      localStorageServiceProvider.setStorageType("sessionStorage");
      // $locationProvider.html5Mode(true);
      $httpProvider.interceptors.push("httpInterceptor");
      $httpProvider.defaults.headers.post["Content-Type"] =
        "application/x-www-form-urlencoded;charset=utf-8";
      $httpProvider.defaults.transformRequest.unshift(function (
        data,
        headersGetter
      ) {
        var key,
          result = [];

        if (typeof data === "string") return data;

        for (key in data) {
          if (data.hasOwnProperty(key))
            result.push(
              encodeURIComponent(key) + "=" + encodeURIComponent(data[key])
            );
        }
        return result.join("&");
      });

      /**
       * The workhorse; converts an object to x-www-form-urlencoded serialization.
       * @param {Object} obj
       * @return {String}
       */
      var param = function (obj) {
        var query = "",
          name,
          value,
          fullSubName,
          subName,
          subValue,
          innerObj,
          i;

        for (name in obj) {
          value = obj[name];
          if (value instanceof Array) {
            for (i = 0; i < value.length; ++i) {
              subValue = value[i];
              fullSubName = name + "[]";
              innerObj = {};
              innerObj[fullSubName] = subValue;
              query += param(innerObj) + "&";
            }
          } else if (value instanceof Object) {
            for (subName in value) {
              subValue = value[subName];
              fullSubName = name + "[" + subName + "]";
              innerObj = {};
              innerObj[fullSubName] = subValue;
              query += param(innerObj) + "&";
            }
          } else if (value !== undefined && value !== null)
            query +=
              encodeURIComponent(name) + "=" + encodeURIComponent(value) + "&";
        }

        return query.length ? query.substr(0, query.length - 1) : query;
      };

      // Override $http service's default transformRequest
      $httpProvider.defaults.transformRequest = [
        function (data) {
          return angular.isObject(data) && String(data) !== "[object File]"
            ? param(data)
            : data;
        }
      ];
      $routeProvider
        .when("/manage/tbapply/:id", {
          templateUrl: "views/manage/tbapply.html",
          controller: "ManageTbapplyCtrl",
          controllerAs: "tbapply"
        })
        .when("/manage/lend/:id", {
          templateUrl: "views/manage/lend.html",
          controller: "ManageLendCtrl",
          controllerAs: "lend"
        })
        .when("/manage/repay/:id", {
          templateUrl: "views/manage/repay.html",
          controller: "ManageRepayCtrl",
          controllerAs: "repay"
        })
        .when("/manage/lendid/:id", {
          templateUrl: "views/manage/lendid.html",
          controller: "ManageLendidCtrl",
          controllerAs: "lendid"
        })
        .when("/manage/repayid/:id", {
          templateUrl: "views/manage/repayid.html",
          controller: "ManageRepayidCtrl",
          controllerAs: "repayid"
        })
        .when("/contract/fgscontract/:id", {
          templateUrl: "views/contract/fgscontract.html",
          controller: "ContractFgscontractCtrl",
          controllerAs: "contract/fgscontract"
        })
        .when("/contract/gccontract/:id", {
          templateUrl: "views/contract/gccontract.html",
          controller: "ContractGccontractCtrl",
          controllerAs: "contract/gccontract"
        })
        .when("/contract/zjcontract/:id", {
          templateUrl: "views/contract/zjcontract.html",
          controller: "ContractZjcontractCtrl",
          controllerAs: "contract/zjcontract"
        })
        .when("/finance/zjfy/:id", {
          templateUrl: "views/finance/zjfy.html",
          controller: "FinanceZjfyCtrl",
          controllerAs: "finance/zjfy"
        })
        .when("/finance/f_zjfy/:id", {
          templateUrl: "views/finance/f_zjfy.html",
          controller: "FinanceFZjfyCtrl",
          controllerAs: "finance/fZjfy"
        })
        .when("/finance/f_bxd/:id", {
          templateUrl: "views/finance/f_bxd.html",
          controller: "FinanceFBxdCtrl",
          controllerAs: "finance/fBxd"
        })
        .when("/finance/f_fkd/:id", {
          templateUrl: "views/finance/f_fkd.html",
          controller: "FinanceFFkdCtrl",
          controllerAs: "finance/fFkd"
        })
        .when("/finance/f_jkd/:id", {
          templateUrl: "views/finance/f_jkd.html",
          controller: "FinanceFJkdCtrl",
          controllerAs: "finance/fJkd"
        })
        .when("/finance/f_zzsdk/:id", {
          templateUrl: "views/finance/f_zzsdk.html",
          controller: "FinanceFZzsdkCtrl",
          controllerAs: "finance/fZjfy"
        })
        .when("/finance/f_gck/:id", {
          templateUrl: "views/finance/f_gck.html",
          controller: "FinanceFGckCtrl",
          controllerAs: "finance/fGck"
        })
        .when("/finance/f_bzj/:id", {
          templateUrl: "views/finance/f_bzj.html",
          controller: "FinanceFBzjCtrl",
          controllerAs: "finance/fBzj"
        })
        .when("/finance/f_sk/:id", {
          templateUrl: "views/finance/f_sk.html",
          controller: "FinanceFSkCtrl",
          controllerAs: "finance/fSk"
        })
        .when("/finance/choosepeople/:flag?", {
          templateUrl: "views/finance/choosepeople.html",
          controller: "FinanceChoosepeopleCtrl",
          controllerAs: "finance/choosepeople"
        })
        .when("/personnel/bdtip/:id", {
          templateUrl: "views/personnel/bdtip.html",
          controller: "PersonnelBdtipCtrl",
          controllerAs: "bdtip"
        })
        .when("/personnel/cctip/:id", {
          templateUrl: "views/personnel/cctip.html",
          controller: "PersonnelCctipCtrl",
          controllerAs: "cctip"
        })
        .when("/personnel/jbtip/:id", {
          templateUrl: "views/personnel/jbtip.html",
          controller: "PersonnelJbtipCtrl",
          controllerAs: "jbtip"
        })
        .when("/personnel/qjtip/:id", {
          templateUrl: "views/personnel/qjtip.html",
          controller: "PersonnelQjtipCtrl",
          controllerAs: "qjtip"
        })
        .when("/personnel/txtip/:id", {
          templateUrl: "views/personnel/txtip.html",
          controller: "PersonnelTxtipCtrl",
          controllerAs: "txtip"
        })
        .when("/personnel/gztip/:id", {
          templateUrl: "views/personnel/gztip.html",
          controller: "PersonnelGztipCtrl",
          controllerAs: "gztip"
        })
        .when("/personnel/tcsqtip/:id", {
          templateUrl: "views/personnel/tcsqtip.html",
          controller: "PersonnelTcsqtipCtrl",
          controllerAs: "tcsqtip"
        })
        .when("/administrator/admin_bz/:id", {
          templateUrl: "views/administrator/admin_bz.html",
          controller: "AdministratorAdminBzCtrl",
          controllerAs: "adminBz"
        })
        .when("/administrator/admin_hyz/:id", {
          templateUrl: "views/administrator/admin_hyz.html",
          controller: "AdministratorAdminHyzCtrl",
          controllerAs: "adminHyz"
        })
        .when("/administrator/admin_jyz/:id", {
          templateUrl: "views/administrator/admin_jyz.html",
          controller: "AdministratorAdminJyzCtrl",
          controllerAs: "adminJyz"
        })
        .when("/administrator/admin_kyz/:id", {
          templateUrl: "views/administrator/admin_kyz.html",
          controller: "AdministratorAdminKyzCtrl",
          controllerAs: "adminKyz"
        })
        .when("/administrator/admin_tzfw/:id", {
          templateUrl: "views/administrator/admin_tzfw.html",
          controller: "AdministratorAdminTzfwCtrl",
          controllerAs: "adminTzfw"
        })
        .when("/administrator/admin_yzzx/:id", {
          templateUrl: "views/administrator/admin_yzzx.html",
          controller: "AdministratorAdminYzzxCtrl",
          controllerAs: "adminYzzx"
        })
        .when("/administrator/admin_zjzczx/:id", {
          templateUrl: "views/administrator/admin_zjzczx.html",
          controller: "AdministratorAdminZjzczxCtrl",
          controllerAs: "adminZjzczx"
        })
        .when("/user/feedback", {
          templateUrl: "views/user/feedback.html",
          controller: "UserFeedbackCtrl",
          controllerAs: "feedback"
        })
        .when("/user/changepswd", {
          templateUrl: "views/user/changepswd.html",
          controller: "UserChangepswdCtrl",
          controllerAs: "changepswd"
        })
        .when("/manage/chooseinfo/:id", {
          templateUrl: "views/manage/chooseinfo.html",
          controller: "ManageChooseinfoCtrl",
          controllerAs: "chooseinfo"
        })
        .when("/administrator/chooseinfo/:id", {
          templateUrl: "views/administrator/chooseinfo.html",
          controller: "AdministratorChooseinfoCtrl",
          controllerAs: "chooseinfo"
        })
        .when("/manage/checktbapply/:id", {
          templateUrl: "views/manage/checktbapply.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checktbapply"
        })
        .when("/contract/checkgccontract/:id", {
          templateUrl: "views/contract/checkgccontract.html",
          controller: "TaskreviewCtrl",
          controllerAs: "contract/checkgccontract"
        })
        .when("/contract/checkzjcontract/:id", {
          templateUrl: "views/contract/checkzjcontract.html",
          controller: "TaskreviewCtrl",
          controllerAs: "contract/checkzjcontract"
        })
        .when("/contract/checkfgscontract/:id", {
          templateUrl: "views/contract/checkfgscontract.html",
          controller: "TaskreviewCtrl",
          controllerAs: "contract/checkfgscontract"
        })
        .when("/contract/checkcgcontract/:id", {
          templateUrl: "views/contract/checkcgcontract.html",
          controller: "TaskreviewCtrl",
          controllerAs: "contract/checkcgcontract"
        })
        .when("/contract/checkzlcontract/:id", {
          templateUrl: "views/contract/checkzlcontract.html",
          controller: "TaskreviewCtrl",
          controllerAs: "contract/checkzlcontract"
        })
        .when("/contract/checkfbcontract/:id", {
          templateUrl: "views/contract/checkfbcontract.html",
          controller: "TaskreviewCtrl",
          controllerAs: "contract/checkfbcontract"
        })
        .when("/contract/checkqtcontract/:id", {
          templateUrl: "views/contract/checkqtcontract.html",
          controller: "TaskreviewCtrl",
          controllerAs: "contract/checkqtcontract"
        })
        .when("/personnel/checkjbtip/:id", {
          templateUrl: "views/personnel/checkjbtip.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checkjbtip"
        })
        .when("/personnel/checkbdtip/:id", {
          templateUrl: "views/personnel/checkbdtip.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checkbdtip"
        })
        .when("/personnel/checktxtip/:id", {
          templateUrl: "views/personnel/checktxtip.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checktxtip"
        })
        .when("/personnel/checkcctip/:id", {
          templateUrl: "views/personnel/checkcctip.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checkcctip"
        })
        .when("/personnel/checkqjtip/:id", {
          templateUrl: "views/personnel/checkqjtip.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checkqjtip"
        })
        .when("/personnel/checkandj/:id", {
          templateUrl: "views/personnel/checkandj.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checkandj"
        })
        .when("/personnel/checkycsq/:id", {
          templateUrl: "views/personnel/checkycsq.html",
          controller: "CheckYcsqController",
        })
        .when("/personnel/checkwcbs/:id", {
          templateUrl: "views/personnel/checkwcbs.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checkwcbs"
        })
        .when("/finance/checkf_zjfy/:id", {
          templateUrl: "views/finance/checkf_zjfy.html",
          controller: "TaskreviewCtrl",
          controllerAs: "finance/checkfZjfy"
        })
        .when("/personnel/checkgztip/:id", {
          templateUrl: "views/personnel/checkgztip.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checkgztip"
        })
        .when("/personnel/checkrsda/:id", {
          templateUrl: "views/personnel/checkrsda.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checkrsda"
        })
        .when("/finance/checkf_fgssk/:id", {
          templateUrl: "views/finance/checkf_fgssk.html",
          controller: "TaskreviewCtrl",
          controllerAs: "finance/checkfFgssk"
        })
        .when("/finance/checkf_fkd/:id", {
          templateUrl: "views/finance/checkf_fkd.html",
          controller: "TaskreviewCtrl",
          controllerAs: "finance/checkfFkd"
        })
        .when("/finance/checkf_yhkh/:id", {
          templateUrl: "views/finance/checkf_yhkh.html",
          controller: "TaskreviewCtrl",
          controllerAs: "finance/checkfYhkh"
        })
        .when("/finance/checkf_zzsdk/:id", {
          templateUrl: "views/finance/checkf_zzsdk.html",
          controller: "TaskreviewCtrl",
          controllerAs: "finance/checkfzzsdk"
        })
        .when("/finance/checkf_bzj/:id", {
          templateUrl: "views/finance/checkf_bzj.html",
          controller: "TaskreviewCtrl",
          controllerAs: "finance/checkfBzj"
        })
        .when("/finance/checkf_glfsk/:id", {
          templateUrl: "views/finance/checkf_glfsk.html",
          controller: "TaskreviewCtrl",
          controllerAs: "finance/checkfGlfsk"
        })
        .when("/finance/checkf_sk/:id", {
          templateUrl: "views/finance/checkf_sk.html",
          controller: "TaskreviewCtrl",
          controllerAs: "finance/checkfSk"
        })
        .when("/finance/checkf_jkd/:id", {
          templateUrl: "views/finance/checkf_jkd.html",
          controller: "TaskreviewCtrl",
          controllerAs: "finance/checkfJkd"
        })
        .when("/finance/checkf_bxd/:id", {
          templateUrl: "views/finance/checkf_bxd.html",
          controller: "TaskreviewCtrl",
          controllerAs: "finance/checkfBxd"
        })
        .when("/finance/checkf_yhbh/:id", {
          templateUrl: "views/finance/checkf_yhbh.html",
          controller: "TaskreviewCtrl",
          controllerAs: "finance/checkfYhbh"
        })
        .when("/finance/checkf_gck/:id", {
          templateUrl: "views/finance/checkf_gck.html",
          controller: "TaskreviewCtrl",
          controllerAs: "finance/checkfGck"
        })
        .when("/finance/checkf_gck_append/:id", {
          templateUrl: "views/finance/checkf_gck.html",
          controller: "CheckGckAppend",
        })
        .when("/finance/checkf_wjz/:id", {
          templateUrl: "views/finance/checkf_wjz.html",
          controller: "TaskreviewCtrl",
          controllerAs: "finance/checkfWjz"
        })
        .when("/finance/checkf_tbfsk/:id", {
          templateUrl: "views/finance/checkf_tbfsk.html",
          controller: "TaskreviewCtrl",
          controllerAs: "finance/checkfTbfsk"
        })
        .when("/finance/checkf_gcsp/:id", {
          templateUrl: "views/finance/checkf_gcsp.html",
          controller: "TaskreviewCtrl",
          controllerAs: "finance/checkfGcsp"
        })
        .when("/personnel/checkyjtc/:id", {
          templateUrl: "views/personnel/checkyjtc.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checkyjtc"
        })
        .when("/manage/check_lend/:id", {
          templateUrl: "views/manage/check_lend.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checkLend"
        })
        .when("/manage/check_lendid/:id", {
          templateUrl: "views/manage/check_lendid.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checkLendid"
        })
        .when("/manage/check_reapy/:id", {
          templateUrl: "views/manage/check_reapy.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checkReapy"
        })
        .when("/manage/check_reapyid/:id", {
          templateUrl: "views/manage/check_reapyid.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checkReapyid"
        })
        .when("/administrator/check_admin_bz/:id", {
          templateUrl: "views/administrator/check_admin_bz.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checkAdminBz"
        })
        .when("/administrator/check_admin_hyz/:id", {
          templateUrl: "views/administrator/check_admin_hyz.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checkAdminHyz"
        })
        .when("/administrator/check_admin_jyz/:id", {
          templateUrl: "views/administrator/check_admin_jyz.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checkAdminJyz"
        })
        .when("/administrator/check_admin_kyz/:id", {
          templateUrl: "views/administrator/check_admin_kyz.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checkAdminKyz"
        })
        .when("/administrator/check_admin_tzfw/:id", {
          templateUrl: "views/administrator/check_admin_tzfw.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checkAdminTzfw"
        })
        .when("/administrator/check_admin_yzzx/:id", {
          templateUrl: "views/administrator/check_admin_yzzx.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checkAdminYzzx"
        })
        .when("/administrator/check_admin_zjzczx/:id", {
          templateUrl: "views/administrator/check_admin_zjzczx.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checkAdminZjzczx"
        })
        .when("/administrator/check_admin_yydj/:id", {
          templateUrl: "views/administrator/check_admin_yydj.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checkAdminYydj"
        })
        .when("/task/taskreport", {
          templateUrl: "views/task/taskreport.html",
          controller: "TaskTaskreportCtrl",
          controllerAs: "taskreport"
        })
        .when("/task/reportdetail/:type/:pkId", {
          templateUrl: "views/task/reportdetail.html",
          controller: "TaskreportdetailCtrl",
          controllerAs: "reportdetail"
        })
        // 新建时候可以传
        .when("/task/newreport/:pkId?", {
          templateUrl: "views/task/newreport.html",
          controller: "TaskNewreportCtrl",
          controllerAs: "newreport"
        })
        .when("/task/newtask", {
          templateUrl: "views/task/newtask.html",
          controller: "TaskNewtaskCtrl",
          controllerAs: "newtask"
        })
        .when("/task/mytask", {
          templateUrl: "views/task/mytask.html",
          controller: "TaskMytaskCtrl",
          controllerAs: "mytask"
        })
        .when("/task/taskdetail/:pkId", {
          templateUrl: "views/task/taskdetail.html",
          controller: "TaskTaskdetailCtrl",
          controllerAs: "taskdetail"
        })
        .when("/relativePage/:module/:name/:formKey/:moduleNo", {
          //模块名/视图名
          templateUrl: function ($routeParams) {
            return (
              "views/" + $routeParams.module + "/" + $routeParams.name + ".html"
            );
          },
          controller: "RelativepageCtrl",
          controllerAs: "relativePage"
        })
        .when("/personnel/ycsq/:id", {
          templateUrl: "views/personnel/ycsq.html",
          controller: "PersonnelYcsqCtrl",
          controllerAs: "personnel/ycsq"
        })
        .when("/personnel/returnycsq/:id", {
          templateUrl: "views/personnel/returnycsq.html",
          controller: "PersonnelReturnycsqCtrl",
          controllerAs: "personnel/returnycsq"
        })
        .when("/personnel/wcbs/:id", {
          templateUrl: "views/personnel/wcbs.html",
          controller: "PersonnelWcbsCtrl",
          controllerAs: "personnel/wcbs"
        })
        .when("/administrator/admin_yydj/:id", {
          templateUrl: "views/administrator/admin_yydj.html",
          controller: "AdministratorAdminYydjCtrl",
          controllerAs: "administrator/adminYydj"
        })
        .when("/finance/f_yhbh/:id", {
          templateUrl: "views/finance/f_yhbh.html",
          controller: "FinanceFYhbhCtrl",
          controllerAs: "finance/fYhbh"
        })
        .when("/finance/f_yhkh/:id", {
          templateUrl: "views/finance/f_yhkh.html",
          controller: "FinanceFYhkhCtrl",
          controllerAs: "finance/fYhkh"
        })
        .when("/finance/f_gcsp/:id", {
          templateUrl: "views/finance/f_gcsp.html",
          controller: "FinanceFGcspCtrl",
          controllerAs: "finance/fGcsp"
        })
        .when("/finance/f_wjz/:id", {
          templateUrl: "views/finance/f_wjz.html",
          controller: "FinanceFWjzCtrl",
          controllerAs: "finance/fWjz"
        })
        .when("/administrator/check_admin_zjdp/:id", {
          templateUrl: "views/administrator/check_admin_zjdp.html",
          controller: "TaskreviewCtrl",
          controllerAs: "administrator/checkAdminZjdp"
        })
        .when("/userdefined/userdefined/:id", {
          templateUrl: "views/userdefined/userdefined.html",
          controller: "UserdefinedUserdefinedCtrl",
          controllerAs: "userdefined/userdefined"
        })
        .when("/userdefined/check_userdefined/:id", {
          templateUrl: "views/userdefined/check_userdefined.html",
          controller: "TaskreviewCtrl",
          controllerAs: "userdefined/userdefined"
        })

        .when("/userdefined/choosePerson", {
          templateUrl: "views/userdefined/chooseperson.html",
          controller: "UserdefinedChoosepersonCtrl",
          controllerAs: "choosePerson"
        })
        .when("/openfile/openfile/:type/:id", {
          templateUrl: "views/openfile/openfile.html",
          controller: "OpenfileOpenfileCtrl",
          controllerAs: "openfile/openfile"
        })
        .when("/manage/bidnotice/:id", {
          templateUrl: "views/manage/bidnotice.html",
          controller: "ManageBidnoticeCtrl",
          controllerAs: "manage/bidnotice"
        })
        .when("/manage/bidcharge/:id", {
          templateUrl: "views/manage/bidcharge.html",
          controller: "ManageBidchargeCtrl",
          controllerAs: "manage/bidcharge"
        })
        .when("/finance/SendDepositApply/:id", {
          templateUrl: "views/finance/senddepositapply.html",
          controller: "FinanceSenddepositapplyCtrl",
          controllerAs: "finance/SendDepositApply"
        })
        .when("/finance/BackDepositApply/:id", {
          templateUrl: "views/finance/backdepositapply.html",
          controller: "FinanceBackdepositapplyCtrl",
          controllerAs: "finance/BackDepositApply"
        })
        .when("/finance/check_SendDepositApply/:id", {
          templateUrl: "views/finance/check_senddepositapply.html",
          controller: "TaskreviewCtrl",
          controllerAs: "finance/SendDepositApply"
        })
        .when("/finance/check_BackDepositApply/:id", {
          templateUrl: "views/finance/check_backdepositapply.html",
          controller: "TaskreviewCtrl",
          controllerAs: "finance/BackDepositApply"
        })
        .when("/manage/chooseperformance", {
          templateUrl: "views/manage/chooseperformance.html",
          controller: "ManageChooseperformanceCtrl",
          controllerAs: "manage/chooseperformance"
        })
        .when("/work/tbnoticeDetail", {
          templateUrl: "views/manage/checktbapply.html",
          controller: "WorkTbnoticedetailCtrl",
          controllerAs: "work/tbnoticeDetail"
        })
        .when("/work/systemnotice/:pkId", {
          templateUrl: "views/work/systemnotice.html",
          controller: "WorkSystemnoticeCtrl",
          controllerAs: "Systemnotice"
        })
        .when("/attendance/index", {
          templateUrl: "views/attendance/index.html",
          controller: "AttendanceIndexCtrl",
          controllerAs: "attendance"
        })
        .when("/attendance/attendance_list", {
          templateUrl: "views/attendance/attendance_list.html",
          controller: "AttendanceAttendanceListCtrl",
          controllerAs: "attendanceList"
        })
        .when("/attendance/edit_location", {
          templateUrl: "views/attendance/edit_location.html",
          controller: "AttendanceEdit_location",
          controllerAs: "addAttendance"
        })
        .when("/attendance/attendance_detail/:pkId?", {
          templateUrl: "views/attendance/attendance_detail.html",
          controller: "AttendanceAttendanceDetailCtrl",
          controllerAs: "attendanceDetail"
        })
        .when("/attendance/attendance_statisticDetail", {
          templateUrl: "views/attendance/attendance_statisticdetail.html",
          controller: "AttendanceAttendanceStatisticdetailCtrl",
          controllerAs: "attendanceStatisticDetail"
        })
        .when("/attendance/attendance_log/:type", {
          templateUrl: "views/attendance/attendance_log.html",
          controller: "AttendanceAttendanceLogCtrl",
          controllerAs: "attendanceLog"
        })
        .when("/attendance/attendance_late/:type", {
          templateUrl: "views/attendance/attendance_late.html",
          controller: "AttendanceAttendanceLateCtrl",
          controllerAs: "attendanceLate"
        })
        .when("/attendance/attendance_outside", {
          templateUrl: "views/attendance/attendance_outside.html",
          controller: "AttendanceAttendanceOutsideCtrl",
          controllerAs: "attendanceOutside"
        })
        .when("/attendance/show_location/:lat/:lng/:distance?", {
          templateUrl: "views/attendance/show_location.html",
          controller: "AttendanceShowLocationCtrl",
          controllerAs: "showLocation"
        })
        .when("/attendance/attendance_user/:id?", {
          templateUrl: "views/attendance/attendance_user.html",
          controller: "AttendanceAttendanceUserCtrl",
          controllerAs: "attendanceUser"
        })
        .when("/attendance/attendance_deps/:id?", {
          templateUrl: "views/attendance/attendance_deps.html",
          controller: "AttendanceAttendanceDepsCtrl",
          controllerAs: "attendanceDeps"
        })
        .when("/finance/addvaluetax/:id", {
          templateUrl: "views/finance/addvaluetax.html",
          controller: "FinanceAddvaluetaxCtrl",
          controllerAs: "finance/addvaluetax"
        })
        .when("/finance/check_addvaluetax/:id", {
          templateUrl: "views/finance/check_addvaluetax.html",
          controller: "TaskreviewCtrl",
          controllerAs: "finance/checkAddvaluetax"
        })
        .when("/administrator/admin_zjdp/:id", {
          templateUrl: "views/administrator/admin_zjdp.html",
          controller: "AdministratorAdminZjdpCtrl",
          controllerAs: "administrator/adminZjdp"
        })
        .when("/personnel/ccsq/:id", {
          templateUrl: "views/personnel/ccsq.html",
          controller: "PersonnelCcsqCtrl",
          controllerAs: "personnel/ccsq"
        })
        .when("/personnel/checkccsq/:id", {
          templateUrl: "views/personnel/checkccsq.html",
          controller: "TaskreviewCtrl",
          controllerAs: "personnel/checkccsq"
        })
        .when("/sign/index", {
          templateUrl: "views/sign/index.html",
          controller: "SignIndexCtrl",
          controllerAs: "signIndex"
        })
        .when("/sign/footmarklist", {
          templateUrl: "views/sign/footmarklist.html",
          controller: "SignFootmarklistCtrl",
          controllerAs: "footmarklist"
        })
        .when("/sign/footmark/:userId?", {
          templateUrl: "views/sign/footmark.html",
          controller: "SignFootmarkCtrl",
          controllerAs: "footmark"
        })
        .when("/sign/footmarkdetail", {
          templateUrl: "views/attendance/show_location.html",
          controller: "SignFootmarkdetailCtrl",
          controllerAs: "showLocation"
        })
        .when("/sign/chooselocation", {
          templateUrl: "views/sign/location.html",
          controller: "SignChooselocationCtrl",
          controllerAs: "chooselocation"
        })
        .when("/chooseuser/index/:url", {
          templateUrl: "views/chooseuser/index.html",
          controller: "ChooseuserIndexCtrl",
          controllerAs: "Chooseuser"
        })
        .when("/manage/introletter/:id", {
          templateUrl: "views/manage/introletter.html",
          controller: "ManageIntroletterCtrl",
          controllerAs: "manage/introletter"
        })
        .when("/manage/check_introletter/:id", {
          templateUrl: "views/manage/check_introletter.html",
          controller: "TaskreviewCtrl",
          controllerAs: "Introletter"
        })
        .when("/finance/f_ws/:id", {
          templateUrl: "views/finance/f_ws.html",
          controller: "FinanceFWsCtrl",
          controllerAs: "finance/fWs"
        })
        .when("/finance/checkf_ws/:id", {
          templateUrl: "views/finance/checkf_ws.html",
          controller: "TaskreviewCtrl",
          controllerAs: "financefWs"
        })
        .when("/contract/tycontract/:id", {
          templateUrl: "views/contract/tycontract.html",
          controller: "ContractTycontractCtrl",
          controllerAs: "contract/tycontract"
        })
        .when("/contract/checktycontract/:id", {
          templateUrl: "views/contract/checktycontract.html",
          controller: "TaskreviewCtrl",
          controllerAs: "tycontract"
        })
        .when("/contract/rktiket/:id", {
          templateUrl: "views/contract/rktiket.html",
          controller: "ContractRktiketCtrl",
          controllerAs: "contract/rktiket"
        })
        .when("/contract/checkrktiket/:id", {
          templateUrl: "views/contract/checkrktiket.html",
          controller: "TaskreviewCtrl",
          controllerAs: "Rktiket"
        })
        .when("/finance/f_jxfp/:id", {
          templateUrl: "views/finance/f_jxfp.html",
          controller: "FinanceFJxfpCtrl",
          controllerAs: "finance/fJxfp"
        })
        .when("/finance/f_xxfp/:id", {
          templateUrl: "views/finance/f_xxfp.html",
          controller: "FinanceFXxfpCtrl",
          controllerAs: "FinanceFXxfpCtrl"
        })
        .when("/finance/checkf_jxfp/:id", {
          templateUrl: "views/finance/checkf_jxfp.html",
          controller: "TaskreviewCtrl",
          controllerAs: "finance/fJxfp"
        })
        .when("/finance/f_jxfp1/:id", {
          templateUrl: "views/finance/f_jxfp1.html",
          controller: "FinanceFJxfp1Ctrl",
          controllerAs: "financeFJxfp1"
        })
        .when("/finance/checkf_jxfp1/:id", {
          templateUrl: "views/finance/checkf_jxfp1.html",
          controller: "TaskreviewCtrl",
          controllerAs: "finance/fJxfp1"
        })
        .when("/finance/checkf_xxfp/:id", {
          templateUrl: "views/finance/checkf_xxfp.html",
          controller: "TaskreviewCtrl",
          controllerAs: "finance/fJxfp"
        })
        .when("/finance/choosemultinfo", {
          templateUrl: "views/finance/choosepeople.html",
          controller: "FinanceChoosemultinfoCtrl",
          controllerAs: "finance/choosemultinfo"
        })
        .when("/project/lendchoose/:projectId", {
          templateUrl: "views/project/lendchoose.html",
          controller: "ProjectChooseLendlistCtrl",
          controllerAs: "finance/projectchoose"
        })
        .when("/personnel/checkgztable/:id", {
          templateUrl: "views/personnel/checkgztable.html",
          controller: "TaskreviewCtrl",
          controllerAs: "checkgztable"
        })
        .when("/search/:module/:name/:id", {
          templateUrl: function ($routeParams) {
            console.log(
              "views/" + $routeParams.module + "/" + $routeParams.name + ".html"
            );
            return (
              "views/" + $routeParams.module + "/" + $routeParams.name + ".html"
            );
          },
          controller: "SearchDetailCtrl",
          controllerAs: "searchDetail"
        })
        .when("/webpage/:module/:name/:id", {
          templateUrl: function ($routeParams) {
            return (
              "views/" + $routeParams.module + "/" + $routeParams.name + ".html"
            );
          },
          controller: "WebpagectrlCtrl",
          controllerAs: "WebpageDetail"
        })
        .when("/task/tasksetting", {
          templateUrl: "views/task/tasksetting.html",
          controller: "TaskTasksettingCtrl",
          controllerAs: "tasksetting"
        })
        .when("/task/edittask", {
          templateUrl: "views/task/edittask.html",
          controller: "TaskEdittaskCtrl",
          controllerAs: "edittask"
        })
        .when("/task/addcomment/:pkId", {
          templateUrl: "views/task/addcomment.html",
          controller: "TaskAddcommentCtrl",
          controllerAs: "addcomment"
        })
        .when("/flowcomment/comment/:uid", {
          templateUrl: "views/flowcomment/comment.html",
          controller: "FlowcommentCommentCtrl",
          controllerAs: "flowcomment"
        })
        .when("/administrator/choosejwz", {
          templateUrl: "views/administrator/choosejwz.html",
          controller: "AdministratorChoosewz",
          controllerAs: "administrator/adminJwz"
        })
        .when("/administrator/choosewzk", {
          templateUrl: "views/administrator/choosejwz.html",
          controller: "AdministratorChoosewz",
          controllerAs: "administrator/adminJwz"
        })
        .when("/administrator/choosehwz", {
          templateUrl: "views/administrator/choosehwz.html",
          controller: "AdministratorChoosewz",
          controllerAs: "administrator/adminJwz"
        })
        .when("/administrator/admin_jwz/:id", {
          templateUrl: "views/administrator/admin_jwz.html",
          controller: "AdministratorAdminJwzCtrl",
          controllerAs: "administrator/adminJwz"
        })
        .when("/administrator/admin_hwz/:id", {
          templateUrl: "views/administrator/admin_hwz.html",
          controller: "AdministratorAdminHwzCtrl",
          controllerAs: "administrator/adminHwz"
        })
        .when("/administrator/check_admin_jwz/:id", {
          templateUrl: "views/administrator/check_admin_jwz.html",
          controller: "TaskreviewCtrl",
          controllerAs: "administrator/adminJwz"
        })
        .when("/administrator/check_admin_hwz/:id", {
          templateUrl: "views/administrator/check_admin_hwz.html",
          controller: "TaskreviewCtrl",
          controllerAs: "administrator/adminHwz"
        })
        .when("/chooseuser/chooseone", {
          templateUrl: "views/userdefined/chooseperson.html",
          controller: "ChooseuserChooseoneCtrl",
          controllerAs: "choosePerson"
        })
        .when("/relmodule/index/:formKey", {
          templateUrl: "views/relmodule/index.html",
          controller: "RelmoduleIndexCtrl",
          controllerAs: "relmodule/index"
        })
        .when("/remark/index/:uid", {
          templateUrl: "views/remark/index.html",
          controller: "RemarkIndexCtrl",
          controllerAs: "remarkIndex"
        })
        .when("/finance/f_lybzj/:id", {
          templateUrl: "views/finance/f_lybzj.html",
          controller: "FinanceFLybzjCtrl",
          controllerAs: "finance/fLybzj"
        })
        .when("/finance/checkf_lybzj/:id", {
          templateUrl: "views/finance/checkf_lybzj.html",
          controller: "TaskreviewCtrl"
        })
        .when("/attendance/wifilist", {
          templateUrl: "views/attendance/wifilist.html",
          controller: "AttendanceWifilistCtrl",
          controllerAs: "Wifilist"
        })
        .when("/filemodule/index/:refId/:formKey", {
          templateUrl: "views/filemodule/index.html",
          controller: "FilemoduleIndexCtrl",
          controllerAs: "filemodule/index"
        })
        .when("/finance/choosecontact", {
          templateUrl: "views/finance/choosecontact.html",
          controller: "FinanceChoosecontactCtrl",
          controllerAs: "finance/choosecontact"
        })
        .when("/finance/choosetycontact", {
          templateUrl: "views/finance/choosetycontact.html",
          controller: "FinanceChoosetycontactCtrl",
          controllerAs: "finance/choosetycontact"
        })
        .when("/finance/choosecbinvoice", {
          templateUrl: "views/finance/choosecbinvoice.html",
          controller: "FinanceChoosecbinvoiceCtrl",
          controllerAs: "finance/choosecbinvoice"
        })
        .when("/administrator/zjhistory/:type/:id", {
          templateUrl: "views/administrator/zjhistory.html",
          controller: "AdministratorZjhistoryCtrl",
          controllerAs: "administrator/zjhistory"
        })
        .when("/project/projectlist", {
          templateUrl: "views/project/projectlist.html",
          controller: "ProjectProjectlistCtrl",
          controllerAs: "project/projectlist"
        })
        .when("/project/gathering/:id", {
          templateUrl: "views/project/gathering.html",
          controller: "ProjectGatheringCtrl",
          controllerAs: "project/gathering"
        })
        .when("/project/check_gathering/:id", {
          templateUrl: "views/project/check_gathering.html",
          controller: "TaskreviewCtrl"
        })
        .when("/project/payment/:id", {
          templateUrl: "views/project/payment.html",
          controller: "ProjectPaymentCtrl",
          controllerAs: "project/payment"
        })
        .when("/project/check_payment/:id", {
          templateUrl: "views/project/check_payment.html",
          controller: "TaskreviewCtrl"
        })
        .when("/project/check_payment_append/:id", {
          templateUrl: "views/project/check_payment.html",
          controller: "CheckPaymentAppend"
        })
        .when("/project/deduct/:id", {
          templateUrl: "views/project/deduct.html",
          controller: "ProjectDeductCtrl",
          controllerAs: "project/deduct"
        })
        .when("/project/check_deduct/:id", {
          templateUrl: "views/project/check_deduct.html",
          controller: "TaskreviewCtrl"
        })
        .when("/project/check_deduct_append/:id", {
          templateUrl: "views/project/check_deduct_append.html",
          controller: "CheckDeductController"
        })
        .when("/project/check_refund/:id", {
          templateUrl: "views/project/check_refund.html",
          controller: "TaskreviewCtrl"
        })
        .when("/project/refund/:id", {
          templateUrl: "views/project/refund.html",
          controller: "ProjectRefundCtrl",
          controllerAs: "project/refund"
        })
        .when("/project/projectinfo/:id", {
          templateUrl: "views/project/projectinfo.html",
          controller: "ProjectProjectinfoCtrl",
          controllerAs: "project/projectinfo"
        })
        .when("/project/check_projectinfo/:id", {
          templateUrl: "views/project/check_projectinfo.html",
          controller: "TaskreviewCtrl"
        })
        .when("/project/modifylist/:id", {
          templateUrl: "views/project/modifylist.html",
          controller: "ProjectModifylistCtrl",
          controllerAs: "project/modifylist"
        })
        .when("/project/gatheringlist/:id/:pkId?", {
          templateUrl: "views/project/gatheringlist.html",
          controller: "ProjectGatheringlistCtrl",
          controllerAs: "project/gatheringlist"
        })
        .when("/contract/supplylist", {
          templateUrl: "views/contract/supplylist.html",
          controller: "ProjectSupplylistCtrl",
        })
        .when("/project/paymentlist/:id", {
          templateUrl: "views/project/paymentlist.html",
          controller: "ProjectPaymentlistCtrl",
          controllerAs: "project/paymentlist"
        })
        .when("/project/costlist/:id/:pkId?", {
          templateUrl: "views/project/costlist.html",
          controller: "ProjectCostlistCtrl",
          controllerAs: "project/costlist"
        })
        .when("/project/refundlist/:id/:pkId?", {
          templateUrl: "views/project/refundlist.html",
          controller: "ProjectRefundlistCtrl",
          controllerAs: "project/refundlist"
        })
        .when("/project/refundlist2/:id/:formKey", {
          templateUrl: "views/project/refundlist2.html",
          controller: "ProjectRefundlist2Ctrl",
          controllerAs: "project/refundlist2"
        })
        .when("/project/recentpaymentlist/:id/:projectId", {
          templateUrl: "views/project/paymentlist.html",
          controller: "ProjectRecentpaymentlistCtrl",
          controllerAs: "project/recentpaymentlist"
        })
        .when("/project/recentgatheringlist/:projectId", {
          templateUrl: "views/project/gatheringlist.html",
          controller: "ProjectRecentgatheringlistCtrl",
          controllerAs: "project/recentgatheringlist"
        })
        .when("/project/repaylist/:projectId", {
          templateUrl: "views/project/repaylist.html",
          controller: "ProjectRepaylistCtrl",
          controllerAs: "project/repaylist"
        })
        .when("/project/topaylist/:projectId/:pkId?", {
          templateUrl: "views/project/topaylist.html",
          controller: "ProjectTopaylistCtrl",
          controllerAs: "project/topaylist"
        })
        .when("/project/balance/:id", {
          templateUrl: "views/project/balance.html",
          controller: "ProjectBalanceCtrl",
          controllerAs: "project/balance"
        })
        .when("/project/check_balance/:id", {
          templateUrl: "views/project/check_balance.html",
          controller: "TaskreviewCtrl"
        })
        .when("/project/check_transfer/:id", {
          templateUrl: "views/project/check_transfer.html",
          controller: "TaskreviewCtrl"
        })
        .when("/project/chooseproject", {
          templateUrl: "views/project/chooseproject.html",
          controller: "ProjectChooseprojectCtrl",
          controllerAs: "project/chooseproject"
        })
        .when("/administrator/admin_cgwz/:id", {
          templateUrl: "views/administrator/admin_cgwz.html",
          controller: "AdministratorAdminCgwzCtrl",
          controllerAs: "administrator/adminCgwz"
        })
        .when("/administrator/check_admin_cgwz/:id", {
          templateUrl: "views/administrator/check_admin_cgwz.html",
          controller: "TaskreviewCtrl",
          controllerAs: "administrator/checkAdminCgwz"
        })
        .when("/project/choosedata", {
          templateUrl: "views/project/choosedata.html",
          controller: "ProjectChoosedataCtrl",
          controllerAs: "project/choosedata"
        })
        .when("/project/check_supplier/:id", {
          templateUrl: "views/project/check_supplier.html",
          controller: "TaskreviewCtrl"
        })
        .when("/project/check_taxpayment/:id", {
          templateUrl: "views/project/check_taxpayment.html",
          controller: "TaskreviewCtrl"
        })
        .when("/project/bcxy/:id", {
          templateUrl: "views/project/bcxy.html",
          controller: "ProjectBcxyCtrl",
          controllerAs: "project/bcxy"
        })
        .when("/project/check_bcxy/:id", {
          templateUrl: "views/project/check_bcxy.html",
          controller: "TaskreviewCtrl",
        })
        .when("/project/projectjk/:id", {
          templateUrl: "views/project/projectjk.html",
          controller: "ProjectProjectjkCtrl",
          controllerAs: "project/projectjk"
        })
        .when("/project/check_projectjk/:id", {
          templateUrl: "views/project/check_projectjk.html",
          controller: "TaskreviewCtrl"
        })
        .when("/project/projectbx/:id", {
          templateUrl: "views/project/projectbx.html",
          controller: "ProjectProjectbxCtrl",
          controllerAs: "project/projectbx"
        })
        .when("/project/check_projectbx/:id", {
          templateUrl: "views/project/check_projectbx.html",
          controller: "TaskreviewCtrl"
        })
        .when("/project/projectjs/:id", {
          templateUrl: "views/project/projectjs.html",
          controller: "ProjectProjectjsCtrl",
          controllerAs: "project/projectjs"
        })
        .when("/project/check_projectjs/:id", {
          templateUrl: "views/project/check_projectjs.html",
          controller: "TaskreviewCtrl"
        })
        .when("/contract/cgcontract/:id", {
          templateUrl: "views/contract/cgcontract.html",
          controller: "ContractCgcontractCtrl",
          controllerAs: "contract/cgcontract"
        })
        .when("/contract/zlcontract/:id", {
          templateUrl: "views/contract/zlcontract.html",
          controller: "ContractZlcontractCtrl",
          controllerAs: "contract/zlcontract"
        })
        .when("/contract/fbcontract/:id", {
          templateUrl: "views/contract/fbcontract.html",
          controller: "ContractFbcontractCtrl",
          controllerAs: "contract/fbcontract"
        })
        .when("/contract/qtcontract/:id", {
          templateUrl: "views/contract/qtcontract.html",
          controller: "ContractQtcontractCtrl",
          controllerAs: "contract/qtcontract"
        })
        .when("/project/check_projectdsks/:id", {
          templateUrl: "views/project/check_projectdsks.html",
          controller: "TaskreviewCtrl"
        })
        .when("/project/check_projectbzj/:id", {
          templateUrl: "views/project/check_projectbzj.html",
          controller: "TaskreviewCtrl"
        })
        .when("/administrator/check_admin_wzrk/:id", {
          templateUrl: "views/administrator/check_admin_wzrk.html",
          controller: "TaskreviewCtrl"
        })
        .when('/project/farmerPay/:id', {
          templateUrl: 'views/project/farmerpay.html',
          controller: 'ProjectFarmerpayCtrl',
          controllerAs: 'project/farmerPay'
        })
        .when("/project/checkfarmerPay/:id", {
          templateUrl: "views/project/checkfarmerPay.html",
          controller: "TaskreviewCtrl",
        })
        .when('/administrator/admin_tzfw_users', {
          templateUrl: 'views/administrator/admin_tzfw_users.html',
          controller: 'AdministratorAdminTzfwUsersCtrl',
          controllerAs: 'adminTzfwUsers'
        })
        .when('/personnel/ajdj/:id', {
          templateUrl: 'views/personnel/ajdj.html',
          controller: 'PersonnelAjdjCtrl',
          controllerAs: 'personnel/ajdj'
        })
        .when('/project/contractlist/:projectId', {
          templateUrl: 'views/project/contractlist.html',
          controller: 'ProjectContractlistCtrl',
          controllerAs: 'project/contractlist'
        })
        .when('/project/nmggzlist/:projectId', {
          templateUrl: 'views/project/nmggzlist.html',
          controller: 'ProjectNmggzlistCtrl',
          controllerAs: 'project/nmggzlist'
        })
        .when('/project/lendlist/:projectId', {
          templateUrl: 'views/project/lendlist.html',
          controller: 'ProjectLendlistCtrl',
          controllerAs: 'project/lendlist'
        })
        .when('/project/reimlist/:projectId', {
          templateUrl: 'views/project/reimlist.html',
          controller: 'ProjectReimlistCtrl',
          controllerAs: 'project/reimlist'
        })
        .when('/project/bzjlist/:projectId', {
          templateUrl: 'views/project/bzjlist.html',
          controller: 'ProjectBzjlistCtrl',
          controllerAs: 'project/bzjlist'
        })
        .when('/project/inInvoicelist/:projectId', {
          templateUrl: 'views/project/ininvoicelist.html',
          controller: 'ProjectIninvoicelistCtrl',
          controllerAs: 'project/inInvoicelist'
        })
        .when('/project/outInvoicelist/:projectId', {
          templateUrl: 'views/project/outinvoicelist.html',
          controller: 'ProjectOutinvoicelistCtrl',
          controllerAs: 'project/outInvoicelist'
        })
        .when('/project/ratpaylist/:projectId', {
          templateUrl: 'views/project/ratpaylist.html',
          controller: 'ProjectRatpaylistCtrl',
          controllerAs: 'project/ratpaylist'
        })
        .when('/project/ratbondlist/:projectId', {
          templateUrl: 'views/project/ratbondlist.html',
          controller: 'ProjectRatbondlistCtrl',
          controllerAs: 'project/ratbondlist'
        })
        .when('/project/taxpayment/:id', {
          templateUrl: 'views/project/taxpayment.html',
          controller: 'ProjectTaxpaymentCtrl',
          controllerAs: 'project/taxpayment'
        })
        .when('/contract/invoicelist', {
          templateUrl: 'views/contract/invoicelist.html',
          controller: 'ContractInvoicelistCtrl',
          controllerAs: 'contract/invoicelist'
        })
        .when('/contract/paymentlist', {
          templateUrl: 'views/contract/paymentlist.html',
          controller: 'ContractPaymentlistCtrl',
          controllerAs: 'contract/paymentlist'
        })
        .when("/material/check_warehouse/:id", {
          templateUrl: "views/material/check_warehouse.html",
          controller: "TaskreviewCtrl",
        })
        .when("/material/check_purchase/:id", {
          templateUrl: "views/material/check_purchase.html",
          controller: "TaskreviewCtrl",
        })
        .when("/material/check_entering/:id", {
          templateUrl: "views/material/check_entering.html",
          controller: "TaskreviewCtrl",
        })
        .when("/material/purchase/:id", {
          templateUrl: "views/material/purchase.html",
          controller: "MaterialPurchaseCtrl",
        })
        .when("/material/entering/:id", {
          templateUrl: "views/material/entering.html",
          controller: "MaterialEnteringCtrl",
        })
        .when("/material/chooseWarehouse", {
          templateUrl: "views/material/warehouselist.html",
          controller: "WarehouseListCtrl",
        })
        .when("/material/materiallist", {
          templateUrl: "views/material/materiallist.html",
          controller: "MaterialList",
        })
        .when("/material/materialplan/:id", {
          templateUrl: "views/material/materialplan.html",
          controller: "MaterialPlan",
        })
        .when("/material/materialtotalplan/:id", {
          templateUrl: "views/material/materialTotalplan.html",
          controller: "MaterialTotalPlan",
        })
        .when("/material/check_picking/:id", {
          templateUrl: "views/material/check_picking.html",
          controller: "TaskreviewCtrl",
        })
        .when("/material/check_return/:id", {
          templateUrl: "views/material/check_return.html",
          controller: "TaskreviewCtrl",
        })
        .when("/material/check_check/:id", {
          templateUrl: "views/material/check_check.html",
          controller: "TaskreviewCtrl",
        })
        .when("/material/check_account/:id", {
          templateUrl: "views/material/check_account.html",
          controller: "TaskreviewCtrl",
        })
        .when("/material/check_order/:id", {
          templateUrl: "views/material/check_order.html",
          controller: "TaskreviewCtrl",
        })
        .when("/material/check_allocate/:id", {
          templateUrl: "views/material/check_allocate.html",
          controller: "TaskreviewCtrl",
        })

      // .otherwise({
      //   redirectTo: "/"
      // });
    }
  ])
  .run(function (Util, $rootScope) {
    Util.init();
    $rootScope.$on("$routeChangeStart", function (event, next, current) {
      // 如果没得后退了就关闭这个webview
      if (!next) {
        event.preventDefault();
        console.log("routeChange");
        NativeUtil.use("close");
      } else {
        // 否则设置当前页面头部
        // console.log(Util.getCurPageViewName());
        Util.handleHashchange();
      }
    });
  });
function bootstrapAngular() {
  var domElement = document.querySelector("body");
  window.JGapp = angular.bootstrap(domElement, ["jgappApp"]);
}
function initRouter() {
  if (window.JGapp) {
    window.JGapp.get("Util").initAngularRouter("REFEASH");
  }
}
document.addEventListener("DOMContentLoaded", bootstrapAngular, false);
